import 'package:flutter_test/flutter_test.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:yeild_libs_rfid_platform_interface/yeild_libs_rfid_method_channel.dart';
import 'package:yeild_libs_rfid_platform_interface/yeild_libs_rfid_platform_interface.dart';

class MockYeildLibsRfidAndroid
    with MockPlatformInterfaceMixin
    implements RfidPlatformInterface {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();
  final RfidPlatformInterface initialPlatform = RfidPlatformInterface.instance;

  test('$RfidPlatformInterface is the default instance', () {
    expect(initialPlatform, isInstanceOf<YeildLibsRfidDefault>());
  });

  test('getPlatformVersion', () async {
    MockYeildLibsRfidAndroid fakePlatform = MockYeildLibsRfidAndroid();
    RfidPlatformInterface.instance = fakePlatform;
    RfidPlatformInterface plugin = RfidPlatformInterface.instance;

    expect(await plugin.getPlatformVersion(), '42');
  });
}
